﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
namespace Entangle
{
    interface ICrypto
    {
        #region RSA Keys
        string GetPublicKeyXML();

        bool LoadPartnerPublicKey();

        byte[] PublicKeyHash{get;}

        byte[] PartnerPublicKeyHash{get;}

        #endregion

        #region RSA Signing/Verification
        string SignData(string data);
        bool VerifyData(string data, string signature, string hashAlgorithmName);
        #endregion

        #region RSA Encryption/Decryption
        byte[] RSAEncryptWithPartnerKeyLongData(byte[] data);
        byte[] RSAEncryptWithPrivateKeyLongData(byte[] data);
        byte[] RSADecryptWithPrivateKeyLongData(byte[] data);

        byte[] RSAEncryptWithPartnerKey(byte[] data);
        byte[] RSADecryptWithPrivateKey(byte[] data);
        byte[] RSAEncryptWithPrivateKey(byte[] data);

        string RSAEncryptWithPartnerKey(string data);
        string RSADecryptWithPrivateKey(string data);
        string RSAEncryptWithPrivateKey(string data);
        #endregion

        #region AES Keys
        string AESCurrentKey{get;}
        void AddNewAESKey(string keyXml);
        #endregion

        #region AES Encryption/Decryption
        string AESEncrypt(string keyID, string data);
        string AESDecrypt(string keyID, string data);

        void EncryptXmlElement(XmlDocument xml, string elementName, string keyId);
        void DecryptXmlElement(XmlDocument xml, string keyId);
        #endregion

    }
    public enum SupportedHashAlgorithms
    {
        SHA512
    }
}
